package org.chen.config;

import lombok.extern.slf4j.Slf4j;
import org.chen.client.VideoClient;
import org.chen.domain.dto.VideoStatisticsDTO;
import org.chen.domain.vo.VideoTaskVO;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * 视频服务降级实现
 */
@Slf4j
@Component
public class VideoClientFallback implements VideoClient {
    
    @Override
    public VideoStatisticsDTO getStatistics() {
        log.error("调用视频服务统计接口失败，返回默认值");
        return new VideoStatisticsDTO();
    }
    
    @Override
    public List<VideoTaskVO> getRecentTasks(int limit) {
        log.error("调用视频服务最近任务接口失败，返回空列表");
        return Collections.emptyList();
    }
    
    @Override
    public Map<String, Integer> getTaskTrend(LocalDateTime startTime, LocalDateTime endTime) {
        log.error("调用视频服务趋势接口失败，返回空Map");
        return Collections.emptyMap();
    }
}